<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/css/default/style.css" />
<link rel="stylesheet" type="text/css" href="/css/qqface/qqFace.css" />
<link rel="stylesheet" type="text/css" href="/css/asyncbox/skins/Chrome/asyncbox.css" />
<link rel="stylesheet" type="text/css" href="/assets/6d60aeb8/pager.css" />
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookies.min.js"></script>
<script type="text/javascript" src="/js/AsyncBox.v1.4.5.js"></script>
<title>printk级别问题-xingzuzi-ChinaUnix博客</title>
<meta name="description" content='printk()printk()应该是每一个驱动开发者最为亲密的伙伴了，我们常常将它与二分查找法结合在一起寻找代码中发生问题的位置。
通常情况下，对于代码中的两个printk()语句，如果一个正常执行，而另一个没有被执行，就说明问题发生在'/>
<script language="javascript">
//用户是否在线
var isOnLine = '';
$(document).ready(function(){
	var blog = {'name': '', 'name_url': '', 'brief': ''};
	//消息通知显示和隐藏控制
	$('#show_message_slide_button').hover(
		function(){
			$('#message_slide_div').slideDown(100);											   
		},
		function(){
			
		}
	);

	$('#message_slide_div').hover(
		function(){
			
		},
		function(){
			$('#message_slide_div').slideUp(100);
		}
	);
	
	//编辑博客名
	$('#editbna').click(function(){
		blog.name = $('#bnaspan a').text();
		var val = '<input id="bnainput" type="text" style="float:left" value="" rel="' +$(this).attr('rel') + '" /><input id="bnasub" type="button" style="float:left" class="btn1"><input id="bnacanl" type="button" style="float:left" class="btn2"><div class="clear"></div>';
		$('#bnaspan').html(val);
		$('#bnainput').val(blog.name);
		$(this).parent().hide();
	});
	
	$('#bnasub').live('click', function(){
	    var rel = eval('({' + $('#bnainput').attr('rel') + '})');
		var name = $('#bnainput').val();
		if(name != blog.name){
	        $.ajax({
			    type: "POST",
			    url: rel.url,	
			    data: {
				    'name' : name
			    },
			    success:function(data){
				    if(data == 0){
						$('#bnaspan').html(blog.name);
						$('#bnaspan').html('<a href="' + rel.href + '">' + $('#bnaspan').html() + '</a>');
				    }else{
						$('#bnaspan').html(data);
						$('#bnaspan').html('<a href="' + rel.href + '">' + $('#bnaspan').html() + '</a>');
				    }
					$('#editbna').parent().show();
				}
			});
		}else{
		    $('#bnaspan').text(blog.name).html();
			$('#bnaspan').html('<a href="' + rel.href + '">' + $('#bnaspan').html() + '</a>');
			$('#editbna').parent().show();
		}
	});
	
	$('#bnacanl').live('click', function(){
		var rel = eval('({' + $('#bnainput').attr('rel') + '})');
		$('#bnaspan').html('<a href="' + rel.href + '">' + blog.name + '</a>');
		$('#editbna').parent().show();
	});
	
	//编辑签名
	$('#editbrief').click(function(){
	    blog.brief = $('#briefem').text();
		var val = '<input id="brfinput" type="text" style="float:left" value="" rel="' + $(this).attr('rel') + '" /><input id="brfsub" style="float:left"  type="button" class="btn1"><input style="float:left"  id="brfcanl" type="button" class="btn2"><div class="clear"></div>';
		$('#briefem').html(val);
		$('#brfinput').val(blog.brief);
		$(this).parent().hide();
	});
	
	$('#brfsub').live('click', function(){
	    var url = $('#brfinput').attr('rel');
		var brief = $('#brfinput').val();
		if(brief != blog.brief){
	        $.ajax({
			    type: "POST",
			    url: url,	
			    data: {
				    'brief' : brief
			    },
			    success:function(data){
				    if(data == 0){
				        $('#briefem').html(blog.brief);
				    }else{
						$('#briefem').html(data);
				    }
					$('#editbrief').parent().show();
				}
			});
		}else{
		    $('#briefem').text(blog.brief).html();
			$('#editbrief').parent().show();
		}
	});
	
	$('#brfcanl').live('click', function(){
		$('#briefem').html(blog.brief);
		$('#editbrief').parent().show();
	});

});
</script>
</head>
<body>
<div class="box">
  <!-- 一级导航 -->
  <div class="Blog_nav1">
    <div class="Blog_nav1_2"><a href="/"><img src="/image/default/1.png"></a><a href="http://www.chinaunix.net" class="Blog_a1">Chinaunix首页</a>　| 　<a href="http://bbs.chinaunix.net" target="_blank">论坛</a>　| 　<a href="http://blog.chinaunix.net" target="_blank">博客</a><span class="Blog_span1"></span>
            <a href="/site/login.html" class="Blog_a1">登录</a> | <a href="http://sso.chinaunix.net/Register?return_url=http%3A%2F%2Ft.cublog.com%2F" class="Blog_a1">注册</a>
          </div>
	<!--自动提示层-->
	<style>
	.bor13221{border:1px #bbb solid;width:206px;position:absolute;top:34px;left:0;background:#fff; z-index:9999;display:none}
	.bor13221 li{height:26px;line-height:26px;padding-left:6px;color:#555;font-size:14px;cursor:pointer;}
	.here{background:#f3f3f3;}
    </style>

	<!--自动提示层-->
    <div class="Blog_nav1_3" style="position:relative; z-index:9999;">
	 <div class="bor13221">
      <ul>
      </ul>
    </div>
	  <form action='/site/search.html' method='post'>
		<input type="text"  autocomplete="off"  class="Blog_txt1" id='search_input_id' name='keywords'>
		<select class="Bolg_sel1" name='type' id='search_type_blog'>
		  <option value='blog'>博文</option>
		  <option value='author'>博主</option>
		</select>
		<input type="submit" value='' name='submit' class="Blog_btn1">
	 </form>
    </div>
    <div class="clear"></div>
    <div class="Blog_nav1_layer1" id="message_slide_div" style="display:none;">
	    <ul>
	    	<li><a href="/message/private.html">私人消息()</a></li>
	    	<li><a href="/message/system.html">系统消息()</a></li>
	    	<li><a href="/member/request.html">好友请求()</a></li>
	    	<li><a href="/member/notification.html">通知管理()</a></li>
	    </ul>
    </div>
  </div>
   <script type="text/javascript">
  	$(function(){
		//点击添加进文本框
		$(".bor13221 li").live( 'click' , function(e){
			if ( e && e.stopPropagation )
			{
				//因此它支持W3C的stopPropagation()方法
				e.stopPropagation();
			}
			else
			{
				//否则，我们需要使用IE的方式来取消事件冒泡
				window.event.cancelBubble = true; 
			}
			$('#search_input_id').val($(this).text());
			$(".bor13221 ul").html('');
			$(".bor13221").hide();
		});
		$(".bor13221 ul li").live({
			mouseenter:
			function()
			{
				$(".bor13221 ul li").removeClass("here");
				$(this).addClass('here');
			},
			mouseleave:
			function()
			{
				$(".bor13221 ul li").removeClass("here");
				$(this).removeClass('here');
			}
		});
		//自动提示
		$('#search_input_id').keyup(function(event){
			//取消博主的提示
			var search_type_blog = $('#search_type_blog').val();
			if(search_type_blog == 'author') return false;

			var key = $(this).val();
			//获取键值
			var keycode = event.which; //38 上 40 下
			var count = $('.bor13221 ul li').length;
			if(key != '' && keycode != 38 && keycode != 40)
			{
				$.getJSON("http://api.sou.it168.com/autoWenKuCloud?jsoncallback=?",{"ty":"json","offset":"0","limit":"10","q":key}, function(result)
					{
						var arr = result.data;

						var html ='';
						for (i=0;i<arr.length ;i++ )   
						{   
							html += '<li>'+arr[i]+'</li>';
						} 
						
						$('.bor13221 ul').html(html);
						(arr.length > 1) ?  $(".bor13221").show() : $(".bor13221").hide();
					}
				);
			}
			else if(keycode == 38)
			{
				if(count > 0)
				{
					//遍历li
					var curr_li_num;
					$('.bor13221 ul li').each(function(index , dom){
						if($(dom).attr('class') == 'here')
						{
							curr_li_num = index;
							return false;
						}
					}); 
					var next_li_num;
					if(typeof(curr_li_num) == 'undefined')
					{
						next_li_num = count - 1;
					}
					else
					{
						if(curr_li_num == 0)
						{
							next_li_num = count - 1;
						}
						else
						{
							next_li_num = curr_li_num - 1;
						}
					}
					$(".bor13221 ul li").removeClass("here");
					$(".bor13221 ul li:eq(" + next_li_num + ")").addClass("here");
					$('#search_input_id').val($(".bor13221 ul li:eq(" + next_li_num + ")").text());
				}
			}
			else if(keycode == 40)
			{
				if(count > 0)
				{
					//遍历li
					var curr_li_num;
					$('.bor13221 ul li').each(function(index , dom){
						if($(dom).attr('class') == 'here')
						{
							curr_li_num = index;
							return false;
						}
					}); 
					var next_li_num;
					if(typeof(curr_li_num) == 'undefined')
					{
						next_li_num = 0;
					}
					else
					{
						if(curr_li_num == count - 1)
						{
							next_li_num = 0;
						}
						else
						{
							next_li_num = curr_li_num + 1;
						}
					}
					$(".bor13221 ul li").removeClass("here");
					$(".bor13221 ul li:eq(" + next_li_num + ")").addClass("here");
					$('#search_input_id').val($(".bor13221 ul li:eq(" + next_li_num + ")").text());
				}
			}
		});
		$(document).click(function(e){
			$(".bor13221").hide();
		});

	});
  </script>
  <!-- 头 -->
  <!-- 推荐博客-->
  <div class="Blog_header1">
	    <div class="Blog_header1_1">
      <p class="Blog_p1" ><em><a href="/uid/10221131.html">一辈子只为一颗豆</a></em><!--<a href="#">gaoke.blog.chinaunix.net</a>--></p>
      <p class="Blog_p2" style="color:#125A94">和你一起慢慢变老，日出日落，春夏秋冬，forever</p>
    </div>
        <div class="Blog_header1_2" id="hide_div1">
    	<span class="Blog_span3"></span>
    	<div class="float_div1" style="white-space:nowrap;" onmouseover="javascript:isMove=false" onmouseout="javascript:isMove=true">
	    <ul id="noticev2">  
		    		    <li><a href="http://sacc.it168.com/zhengwen/" target="_blank">五周年特别奉献：《IT架构实录》征文活动</a></li>
		    		    <li><a href="http://blog.chinaunix.net/uid-24789255-id-3755388.html" target="_blank">【原创评选】2013年6-7月原创博文评选开始啦！</a></li>
		    		    <li><a href="http://aijiake.com/album/218011" target="_blank">梦想之家大赛晒装修,四天三夜港澳双人游</a></li>
		    	    </ul>
	    </div>
    </div>
            <div class="Blog_header1_3"><a href="/uid/10221131.html">首页</a>　| 　<a href="/uid/10221131/abstract/1.html">博文目录</a>　| 　<a href="/member/profile/uid/10221131.html">关于我</a></div>
  </div>
    
  <!-- 内容部分 -->
  	<script type="text/javascript" src="/highlight/scripts/XRegExp.js"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
<script type="text/javascript" src="/highlight/scripts/shCore.js"></script>
<script type="text/javascript" src="/highlight/scripts/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="/highlight/styles/shCore.css"/>
<link type="text/css" rel="Stylesheet" href="/highlight/styles/shThemeDefault.css" />
<link href="/code/css/fck_editorarea.css" rel="stylesheet" type="text/css" />
  <div class="Blog_contain"> 
    <!-- 左 -->
	<script language="javascript">
$(document).ready(function(){
	$('#ConcernBtn').bind('click',function(){
			var cuid = '10221131';
			var url =  '/member/concern.html';
			var type = $(this).attr('rel');
		
			if(type == 'addConcern'){
				$.ajax({
					type : 'get',
					url  : url,
					data : {'op' : 'ajaxadd' , 'cuid' : cuid, 'random' : Math.random()},
					success : function(msg){	
					   if(msg == -1){
						   showErrorMsg('参数错误！');
					   } else if (msg == 0){
						   showErrorMsg('关注失败，没有该用户！');
					   } else if (msg == 1){
						   showErrorMsg('关注失败，您已经关注了该用户！');
					   } else if (msg == 2){
						   $('#ConcernBtn').val('已关注');
						   $('#ConcernBtn').attr('rel','delConcern');
						   showSucceedMsg('关注成功!');
					   } else if (msg == 3){
						   showErrorMsg('未知错误');
					   }
					}
				});	
			} else if ( type == 'delConcern'){
				$.ajax({
					type : 'get',
					url  : url,
					data : {'op' : 'ajaxdel' , 'cuid' : cuid, 'random' : Math.random()},
					success : function(msg){
					   if(msg == 0){
						   showErrorMsg('参数错误！','消息提示');
					   } else if (msg == 1){
						   showErrorMsg('操作失败，请尝试刷新页面重试！','消息提示');
					   } else if (msg == 2){
						   $('#ConcernBtn').val('加关注');
						   $('#ConcernBtn').attr('rel','addConcern');
						   showSucceedMsg('成功取消关注！','消息提示');
					   } else if (msg == 3){
						   showErrorMsg('未知错误！','消息提示'); 
					   }
					}
				});	
			}
	});					   
});

//加好友
function addFriend(fuid, url){
	if(fuid == '' || fuid.length == 0){
		showErrorMsg('缺少参数！','信息提示');
		return false;
	}
	$.ajax({
		   type : 'get',
		   url : url,
		   data : {'op' : 'add', 'fuid' : fuid , 'random' : Math.random()},
		   success : function(msg){
				if(msg == -1){
					showErrorMsg('参数错误！','消息提示');
				} else if (msg == -2){
					showErrorMsg('添加好友失败,没有该用户的信息！','消息提示');
				} else if (msg == -3){
					showErrorMsg('添加好友失败,你不能添加自己为好友！','消息提示');
				} else if (msg == -4){
					showErrorMsg('添加好友未知错误,该错误已被记录！','消息提示');
				} else if (msg == -5){
					showErrorMsg('添加好友失败,你之前已经发送过好友请求,请耐心等待对方同意申请！','消息提示');
				} else if (msg == -6){
					showErrorMsg('添加好友失败,你们已经是好友了！','消息提示');
				} else {
					$.cover(true);
					asyncbox.open({
						id : 'addFriend',
						title : '添加好友',
						url : url,
						data : {'op' : 'add', 'fuid' : fuid , 'random' : Math.random()},
						width : 490,
						height : 180,
						scroll : 'no',
						callback : function(action) {
							if (action == 'close'){
								$.cover(false);
							}	
						}
					});	
				}
		   }
	});	
	
}

//发送短消息
function postMessage(msguid, url){
	if(msguid == '' || msguid.length == 0){
		showErrorMsg('缺少参数！','信息提示');
		return false;
	}
	
	$.ajax({
		   type : 'post',
		   url : url,
		   data : {'op' : 'ajaxpost', 'msguid' : msguid , 'random' : Math.random()},
		   success : function(msg){
				if(msg == -1){
					showErrorMsg('发送失败，缺少收件人对象！','消息提示');
				} else if(msg == -2){
					showErrorMsg('发送失败，自己不能给自己发送短消息！','消息提示');
				} else {
					$.cover(true);
					asyncbox.open({
						id : 'postMessage',
						title : '发送短消息',
						url : url,
						data : {'op' : 'ajaxpost', 'msguid' : msguid , 'random' : Math.random()},
						width : 510,
						height : 255,
						scroll : 'no',
						callback : function(action) {
							if (action == 'close'){
								$.cover(false);
							}	
						}
					});	
				}
		   }
	});	
}

</script>
<div class="Blog_left">
      <div class="Blog_left1 Blog_bg1">
        <div class="Blog_left1_1">
			<!-- 专家博客-->
			<a href="/uid/10221131.html"><img src="http://passport.ixpub.net/data/avatar/010/22/11/31_avatar_middle.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_middle.gif'" /></a>
            <p><a href="/uid/10221131.html">xingzuzi</a></p>
        </div>
        <ul class="Blog_ul1 Blog_noline1">
          <li>博客访问： 78796 </li>
          <li>博文数量： 172 </li>
          <li>博客积分： 2998 </li>
          <!--<li>专家积分： 180</li>-->
          <li>博客等级： 少校 </li>
		  <li>技术积分： 1302 </li>
          <li>用  户  组：  普通用户</li>
          <li>注册时间： 2010-10-28 09:39 </li>
          <li></li>
        </ul>  
        
                <div class="HT_line3 HT_line3_1"></div>
        <ul class="Blog_ul2">
          <li><input type="button" value="加关注" id="ConcernBtn" onclick="showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html')"></li>
          <li><input type="button" value="短消息" id="postMessageBtn" onclick="showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html')"></li>
          <li><input type="button" value="论坛" onclick="location.href='http://bbs.chinaunix.net'"></li>
          <li><input type="button" value="加好友" id="addFriendBtn" onclick="showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html')"></li>
        </ul>
              </div>
        
         
      <div class="Blog_left2 Blog_bg1">
        <div class="Blog_tit1">文章分类</div>
        <div class="Blog_left2_1">
          <p class="Blog_p4"><a href="/uid/10221131/list/1.html">全部博文</a>（172）</p>
          <ul id="blogCla">
                            <li><a href="/uid/10221131/cid-26289-list-1.html" title="通信相关">通信相关</a>（6）
                                </li>
                            <li><a href="/uid/10221131/cid-24501-list-1.html" title="生活">生活</a>（0）
                                </li>
                            <li><a href="/uid/10221131/cid-22606-list-1.html" title="c++">c++</a>（16）
                                </li>
                            <li><a href="/uid/10221131/cid-22328-list-1.html" title="C语言问题">C语言问题</a>（10）
                                </li>
                            <li><a href="/uid/10221131/cid-20837-list-1.html" title="网络相关">网络相关</a>（6）
                                </li>
                            <li><a href="/uid/10221131/cid-16872-list-1.html" title="embed problem">embed problem</a>（6）
                                </li>
                            <li><a href="/uid/10221131/cid-16871-list-1.html" title="linux application">linux applicatio</a>（59）
                                </li>
                            <li><a href="/uid/10221131/cid-16870-list-1.html" title="linux skill">linux skill</a>（28）
                                </li>
                            <li><a href="/uid/10221131/cid-16869-list-1.html" title="linux driver">linux driver</a>（16）
                                </li>
                            <li><a href="/uid/10221131/cid-16868-list-1.html" title="linux kernel">linux kernel</a>（22）
                                </li>
                            <li><a href="/uid/10221131/cid--1-list-1.html" title="未分配的博文">未分配的博文</a>（3）
                                </li>
                      </ul>
        </div>
      </div>
                  <div class="Blog_left2 Blog_bg1">
        <div class="Blog_tit1">文章存档</div>
        <div class="Blog_left2_1" id="blogdtr">
                    <p class="Blog_p4"><span class="Blog_jia1"></span><a href="/uid/10221131/year-2012-list-1.html">2012年</a>（7）</p>
          <ul style="display:none;" class="Blog_ul3 zk">
                        <li><a href="/uid/10221131/year-201211-list-1.html">2012年11月</a>（2）</li>
                        <li><a href="/uid/10221131/year-201209-list-1.html">2012年09月</a>（1）</li>
                        <li><a href="/uid/10221131/year-201208-list-1.html">2012年08月</a>（4）</li>
                      </ul>
                    <p class="Blog_p4"><span class="Blog_jia1"></span><a href="/uid/10221131/year-2011-list-1.html">2011年</a>（126）</p>
          <ul style="display:none;" class="Blog_ul3 zk">
                        <li><a href="/uid/10221131/year-201112-list-1.html">2011年12月</a>（1）</li>
                        <li><a href="/uid/10221131/year-201110-list-1.html">2011年10月</a>（5）</li>
                        <li><a href="/uid/10221131/year-201108-list-1.html">2011年08月</a>（3）</li>
                        <li><a href="/uid/10221131/year-201107-list-1.html">2011年07月</a>（5）</li>
                        <li><a href="/uid/10221131/year-201106-list-1.html">2011年06月</a>（19）</li>
                        <li><a href="/uid/10221131/year-201105-list-1.html">2011年05月</a>（55）</li>
                        <li><a href="/uid/10221131/year-201104-list-1.html">2011年04月</a>（38）</li>
                      </ul>
                    <p class="Blog_p4"><span class="Blog_jia1"></span><a href="/uid/10221131/year-2010-list-1.html">2010年</a>（39）</p>
          <ul style="display:none;" class="Blog_ul3 zk">
                        <li><a href="/uid/10221131/year-201011-list-1.html">2010年11月</a>（28）</li>
                        <li><a href="/uid/10221131/year-201010-list-1.html">2010年10月</a>（11）</li>
                      </ul>
                  </div>
      </div>
            <div class="Blog_left2 Blog_bg1">
        <div class="Blog_tit1">我的朋友</div>
        <ul class="Blog_ul4">
                    <li><a href="/uid/25318628.html"><img src="http://passport.ixpub.net/data/avatar/025/31/86/28_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/25318628.html" title="commshare">commshar</a></p>
          </li>
                    <li><a href="/uid/12413034.html"><img src="http://passport.ixpub.net/data/avatar/012/41/30/34_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/12413034.html" title="liuxuquan2007">liuxuqua</a></p>
          </li>
                    <li><a href="/uid/24399976.html"><img src="http://passport.ixpub.net/data/avatar/024/39/99/76_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/24399976.html" title="liurhyme">liurhyme</a></p>
          </li>
                    <li><a href="/uid/24462432.html"><img src="http://passport.ixpub.net/data/avatar/024/46/24/32_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/24462432.html" title="小雅贝贝">小雅贝贝</a></p>
          </li>
                    <li><a href="/uid/25544838.html"><img src="http://passport.ixpub.net/data/avatar/025/54/48/38_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/25544838.html" title="网络安全服务">网络安全</a></p>
          </li>
                    <li><a href="/uid/22547469.html"><img src="http://passport.ixpub.net/data/avatar/022/54/74/69_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/22547469.html" title="guangmangdz">guangman</a></p>
          </li>
                    <li><a href="/uid/25873498.html"><img src="http://passport.ixpub.net/data/avatar/025/87/34/98_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/25873498.html" title="等你的短信">等你的短</a></p>
          </li>
                    <li><a href="/uid/128922.html"><img src="http://passport.ixpub.net/data/avatar/000/12/89/22_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/128922.html" title="gothic">gothic</a></p>
          </li>
                    <li><a href="/uid/23629988.html"><img src="http://passport.ixpub.net/data/avatar/023/62/99/88_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/23629988.html" title="GFree_Wind">GFree_Wi</a></p>
          </li>
                  </ul>
      </div>
      <div class="Blog_left2 Blog_bg1">
        <div class="Blog_tit1">最近访客</div>
        <ul class="Blog_ul4">
                    <li><a href="/uid/25764156.html"><img src="http://passport.ixpub.net/data/avatar/025/76/41/56_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/25764156.html" title="猪也有春天">猪也有春</a></p>
          </li>
                    <li><a href="/uid/26440856.html"><img src="http://passport.ixpub.net/data/avatar/026/44/08/56_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/26440856.html" title="cu博客助理">cu博客助</a></p>
          </li>
                    <li><a href="/uid/25784620.html"><img src="http://passport.ixpub.net/data/avatar/025/78/46/20_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/25784620.html" title="chaozhong_152">chaozhon</a></p>
          </li>
                    <li><a href="/uid/26000137.html"><img src="http://passport.ixpub.net/data/avatar/026/00/01/37_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/26000137.html" title="heart2011">heart201</a></p>
          </li>
                    <li><a href="/uid/28712108.html"><img src="http://passport.ixpub.net/data/avatar/028/71/21/08_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/28712108.html" title="YB_NingYan">YB_NingY</a></p>
          </li>
                    <li><a href="/uid/28718587.html"><img src="http://passport.ixpub.net/data/avatar/028/71/85/87_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/28718587.html" title="hou_303">hou_303</a></p>
          </li>
                    <li><a href="/uid/22405978.html"><img src="http://passport.ixpub.net/data/avatar/022/40/59/78_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/22405978.html" title="gwgrisk">gwgrisk</a></p>
          </li>
                    <li><a href="/uid/28614218.html"><img src="http://passport.ixpub.net/data/avatar/028/61/42/18_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/28614218.html" title="sausi學">sausi學</a></p>
          </li>
                    <li><a href="/uid/28899068.html"><img src="http://passport.ixpub.net/data/avatar/028/89/90/68_avatar_small.jpg" onerror="this.onerror=null;this.src='http://passport.ixpub.net/images/noavatar_small.gif'" /></a>
            <p><a href="/uid/28899068.html" title="gain133">gain133</a></p>
          </li>
                  </ul>
      </div>
      <div class="Blog_left2 Blog_bg1">
        <div class="Blog_tit1">订阅</div>
        <ul class="Blog_ul5">
          <li><a href="/blog/rss/uid/10221131.html" class="Blog_a4"></a></li>
          <li><a href="http://www.google.com/ig/add?feedurl=http%3A%2F%2Fblog.chinaunix.net%2Fuid%2F10221131.html" class="Blog_a5"></a></li>
        </ul>
      </div>
      <div class="Blog_left2 Blog_left3 Blog_bg1">
        <div class="Blog_tit1">推荐博文</div>
        <ul class="Blog_ul6">
				  			<li>·<a href="/uid-25196040-id-3763356.html" title="IHS参数说明">IHS参数说明</a></li>
		  			<li>·<a href="/uid-28852942-id-3763353.html" title="线程控制：线程与信号">线程控制：线程与信号...</a></li>
		  			<li>·<a href="/uid-124509-id-3171202.html" title="PXE+Kickstart安装RHEL5.5+R5000.8+jason8.1步骤">PXE+Kickstart安装RHEL5.5+R5...</a></li>
		  			<li>·<a href="/uid-13328506-id-3763275.html" title="总之我们早晚都会死——leo鉴书12">总之我们早晚都会死——leo鉴...</a></li>
		  			<li>·<a href="/uid-26893610-id-3762699.html" title="Cisco 设备启动过程介绍">Cisco 设备启动过程介绍...</a></li>
		  		        </ul>
      </div>
      <div class="Blog_left2 Blog_left3 Blog_bg1">
        <div class="Blog_tit1">热词专题</div>
        <ul class="Blog_ul6">
                        <li >·<a href="http://blog.chinaunix.net/zhuanti/101151/wufabaocundayinshezhicaozuowufawanchengcuowu0x000006d9_1011507745.shtml" target='blank' title='无法保存打印设置，操作无法完成错误0x000006d9'>无法保存打印设置，操作无法...</a></li>
                        <li >·<a href="http://blog.chinaunix.net/zhuanti/101152/linuxideaziti_1011519273.shtml" target='blank' title='linux idea 字体'>linux idea 字体</a></li>
                        <li >·<a href="http://blog.chinaunix.net/zhuanti/101164/urllibrequestboke_1011633305.shtml" target='blank' title='urllibrequest  博客'>urllibrequest  博客</a></li>
                        <li >·<a href="http://blog.chinaunix.net/zhuanti/101152/HWiNFO32wufajiazai_1011518729.shtml" target='blank' title='HWiNFO32 无法加载'>HWiNFO32 无法加载</a></li>
                        <li class="no_line1">·<a href="http://blog.chinaunix.net/zhuanti/101164/cpushiyonglvjisuan_1011637235.shtml" target='blank' title='cpu使用率 計算'>cpu使用率 計算</a></li>
                  </ul>
      </div>

      <div class="Blog_left2 Blog_left3 Blog_bg1">
        <div class="Blog_tit1">友情链接</div>
        <ul class="Blog_ul6">
                  </ul>
      </div>


	</div>
<script language="javascript">
$(document).ready(function(){
    /*目录树JS效果*/
	$('#blogCla li > span').click(function(){
		var cla = $(this).attr('class');
		if(cla == 'Blog_jia1'){
			//$('#blogCla li > span').removeClass('Blog_jian1').addClass('Blog_jia1');
			//$('#blogCla li > .zk').css('display', 'none');
				
			$(this).removeClass('Blog_jia1').addClass('Blog_jian1');
            $(this).parent().children('.zk').css('display', 'block');
		}else{
			$(this).removeClass('Blog_jian1').addClass('Blog_jia1');
            $(this).parent().children('.zk').css('display', 'none');
		}
	});
		
	$('#blogdtr > p > span').click(function(){
		var cla = $(this).attr('class');
		if(cla == 'Blog_jia1'){
			//$('#blogdtr > .Blog_p4 > span').removeClass('Blog_jian1').addClass('Blog_jia1');
			//$('#blogdtr ul').css('display', 'none');
				
			$(this).removeClass('Blog_jia1').addClass('Blog_jian1');
            $(this).parent().next().css('display', 'block');
		}else{
			$(this).removeClass('Blog_jian1').addClass('Blog_jia1');
            $(this).parent().next().css('display', 'none');
		}
	});
});
</script>    <!-- 右 -->
    <div class="Blog_right1">
      <div class="Blog_right1_1 Blog_right1_11">
        <div class="Blog_right1_2 ">
			<!--推荐博文-->
          <div class="Blog_tit4 Blog_tit5">
                        <b class="Blog_b2"></b>
            <a href="/uid-10221131-id-205297.html">printk级别问题</a>
            <em>2010-10-28 14:23:37</em>
          </div>
          <div class="Blog_con2">
            <div class="Blog_con3">
              <p>分类： <span>LINUX</span></p>
			                </p>
            </div>
           <div class="Blog_wz1" style='word-wrap: break-word;'>
			<DIV>printk()<BR>printk()应该是每一个驱动开发者最为亲密的伙伴了，我们常常将它与二分查找法结合在一起寻找代码中发生问题的位置。</DIV>
<DIV>通常情况下，对于代码中的两个printk()语句，如果一个正常执行，而另一个没有被执行，就说明问题发生在这两个printk()之间，接下来就可以在这个范围内应用二分查找法定位有问题的代码。</DIV>
<DIV>1. printk()与printf()</DIV>
<DIV>用户空间有printf()，内核空间有printk()，它们就如代表善与恶的命运双生子，即使长相功能如何的接近，都不能在代码中共存。</DIV>
<DIV>对于我们来说，最容易犯的错误是，在需要printk()的地方误用了printf()，而在需要printf()的地方却又误用了printk()，通常这都不会是因为不知道它们的区别，而只是习惯使然。民间流传有这样的说法：当你在编写用户空间应用程序的时候，下意识写出的都是printk()，那么就说明你是个标准的内核开发者了。</DIV>
<DIV>2. printk()的消息级别</DIV>
<DIV>printk()与printf()的一个重要区别就是前者可以指定消息的打印级别，内核根据这个指定的级别来决定是否将消息打印到终端上。如下表所示，printk()共有8个级别。</DIV>
<DIV>级别<BR>&nbsp;描述<BR>&nbsp;<BR>KERN_EMERG<BR>&nbsp;紧急情况，系统可能会崩溃<BR>&nbsp;<BR>KERN_ALERT<BR>&nbsp;必须立即响应<BR>&nbsp;<BR>KERN_CRIT<BR>&nbsp;临界情况<BR>&nbsp;<BR>KERN_ERR<BR>&nbsp;错误信息<BR>&nbsp;<BR>KERN_WARNING<BR>&nbsp;警告信息<BR>&nbsp;<BR>KERN_NOTICE<BR>&nbsp;普通的但可能需要注意的信息<BR>&nbsp;<BR>KERN_INFO<BR>&nbsp;提示性信息<BR>&nbsp;<BR>KERN_DEBUG<BR>&nbsp;调试信息<BR>&nbsp;</DIV>
<DIV>如果没有指定消息的级别，printk()会使用默认的DEFAULT_MESSAGE_LOGLEVEL（通常是KERN_WARNING）。</DIV>
<DIV>3. 控制台的日志级别（console_loglevel）</DIV>
<DIV>当printk指定的消息级别小于指定的控制台日志级别时，消息的内容就会显示在该控制台上。控制台的日志级别定义在include/linux/kernel.h文件中，默认为DEFAULT_CONSOLE_LOGLEVEL（值等于7），也就是说默认情况下，比KERN_DEBUG级别高的printk()消息内容都可以在控制台上显示。</DIV>
<DIV>我们可以执行下面的命令使任何级别的printk()消息都被打印在终端上</DIV>
<DIV>$ echo 8 &gt; /proc/sys/kernel/printk</DIV>
<DIV>4. printk()的变体</DIV>
<DIV>内核在include/linux/kernel.h文件中提供了两个printk()的变体pr_debug和pr_info，它们的定义为：</DIV>
<DIV>235 #define pr_debug(fmt,arg...) \</DIV>
<DIV>236 printk(KERN_DEBUG fmt,##arg)</DIV>
<DIV>244 #define pr_info(fmt,arg...) \</DIV>
<DIV>245 printk(KERN_INFO fmt,##arg)</DIV>
<DIV>5. printk()不是万能的</DIV>
<DIV>printk()虽然很好用，但它并不是万能的，在系统启动时，终端还没有初始化之前，它并不能被使用，不过如果不是在调试系统的启动过程的话，这并不能算是个问题。</DIV>
<DIV>其实内核提供了一个printk()的变体early_printk()，专门用于在系统启动的初期在终端上打印消息，它与printk()的区别仅仅在于名字的不同以及它能够更早地工作。</DIV>
<DIV>&nbsp;</DIV>
<DIV>本文来自CSDN博客，转载请标明出处：<A href="http://blog.csdn.net/fudan_abc/archive/2010/04/29/5543647.aspx">http://blog.csdn.net/fudan_abc/archive/2010/04/29/5543647.aspx</A></DIV>           </div>
            <!-- <div class="Blog_con3_1">管理员在2009年8月13日编辑了该文章文章。</div> -->
            <div class="Blog_con2_1 Blog_con3_2">
              <div>
			  <!--<img src="/image/default/tu_8.png">-->
			  <!-- JiaThis Button BEGIN -->
				<DIV class="bshare-custom icon-medium-plus"><A class=bshare-qzone title=分享到QQ空间></A><A class=bshare-sinaminiblog title=分享到新浪微博></A><A class=bshare-renren title=分享到人人网></A><A class=bshare-qqmb title=分享到腾讯微博></A><A class=bshare-douban title=分享到豆瓣></A><A class="bshare-more bshare-more-icon more-style-addthis" title=更多平台></A></DIV>
				<SCRIPT type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=3&amp;lang=zh"></SCRIPT>

				<SCRIPT type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></SCRIPT>
				<!-- JiaThis Button END -->
			  </div>
              阅读(1781) | 评论(0) | 转发(1) |
			                <div class="HT_line3"></div>
            </div>
            <div class="Blog_con3_3">
              <div><span id='digg_num'>0</span><a href="javascript:void(0)" id='digg' bid='205297' url='/blog/digg.html' ></a></div>
              <p>上一篇：没有了</p>
              <p>下一篇：<a href="/uid-10221131-id-205306.html">全面的framebuffer详解</a></p>
            </div>
          </div>
          <div class="Blog_con3_4">
            <div class="Blog_tit2 Blog_tit6">相关热门文章</div>
			            <ul class="Blog_ul7">
						  <li><span class="Blog_span6"></span><a href="http://blog.chinaunix.net/uid-26835185-id-3764191.html" title='第二篇，puppet的初步配置 ' target='blank' >第二篇，puppet的初步配置 ...</a></li>
						  <li><span class="Blog_span6"></span><a href="http://blog.chinaunix.net/uid-28893482-id-3764174.html" title='对物联网的看法' target='blank' >对物联网的看法</a></li>
						  <li><span class="Blog_span6"></span><a href="http://blog.chinaunix.net/uid-22334392-id-3764172.html" title='COBOL 88level' target='blank' >COBOL 88level</a></li>
						  <li><span class="Blog_span6"></span><a href="http://blog.chinaunix.net/uid-22837947-id-3764171.html" title='LVDS接口转TTL接口板' target='blank' >LVDS接口转TTL接口板</a></li>
						  <li><span class="Blog_span6"></span><a href="http://blog.chinaunix.net/uid-22837947-id-3764163.html" title='LVDS信号' target='blank' >LVDS信号</a></li>
			            </ul>
			            <ul class="Blog_ul7">
						  <li><span class="Blog_span7"></span><a href="/uid-10900999-id-2920737.html" title='linux 常见服务端口' target='blank' >linux 常见服务端口</a></li>
						  <li><span class="Blog_span7"></span><a href="/uid-20378509-id-1956694.html" title='什么是shell' target='blank' >什么是shell</a></li>
						  <li><span class="Blog_span7"></span><a href="/uid-233938-id-162618.html" title='linux socket的bug??' target='blank' >linux socket的bug??</a></li>
						  <li><span class="Blog_span7"></span><a href="/uid-233938-id-162607.html" title='linux的线程是否受到了保护？' target='blank' >linux的线程是否受到了保护？...</a></li>
						  <li><span class="Blog_span7"></span><a href="/uid-233938-id-162600.html" title='一个适用于windows和linux的抓包程序' target='blank' >一个适用于windows和linux的抓...</a></li>
			            </ul>
            <ul class="Blog_ul7">
						  <li><span class="Blog_span6"></span><a href="/uid-25196040-id-3763356.html" title='IHS参数说明' target='blank'  >IHS参数说明</a></li>
						  <li><span class="Blog_span6"></span><a href="/uid-28852942-id-3763353.html" title='线程控制：线程与信号' target='blank'  >线程控制：线程与信号...</a></li>
						  <li><span class="Blog_span6"></span><a href="/uid-124509-id-3171202.html" title='PXE+Kickstart安装RHEL5.5+R5000.8+jason8.1步骤' target='blank'  >PXE+Kickstart安装RHEL5.5+R50...</a></li>
						  <li><span class="Blog_span6"></span><a href="/uid-28750573-id-3762879.html" title='限制Linux系统目录数和文件数' target='blank'  >限制Linux系统目录数和文件数...</a></li>
						  <li><span class="Blog_span6"></span><a href="/uid-10154874-id-3763002.html" title='CentOS 开机自动启动某些服务--chkconfig使用' target='blank'  >CentOS 开机自动启动某些服务-...</a></li>
			            </ul>
            <div class="clear"></div>
          </div>
		  <!--
          <div class="Blog_con3_4 Blog_con3_5">
            <div class="Blog_tit2 Blog_tit7">热门推荐</div>
            <ul>
			              <li><a href="" title="" target='blank' ></a></li>
			            </ul>
          </div>
		  -->
        </div>
      </div>
      <div class="Blog_right1_7" id='replyList'>
		<div class="Blog_tit3">给主人留下些什么吧！~~</div>
				<!--暂无内容-->
				<!-- 评论分页-->
		<div class="Blog_right1_6 Blog_right1_12">
        		</div>
		<!-- 评论分页-->
        <div class="Blog_right1_10">
          <div class="Blog_tit3">评论热议</div>
		  		 <!--未登录 -->
        <div class="Blog_right1_8">
          <div class="nologin_con1"> 请登录后评论。
            <p><a href="/site/login.html">登录</a> <a href="http://sso.chinaunix.net/Register?return_url=http%3A%2F%2Ft.cublog.com%2F">注册</a></p>
          </div>
        </div>
		
        </div>
      </div>
    </div>
  </div>
  <input type='hidden' id='report_url' value='/blog/ViewReport.html' />

<script type="text/javascript">
  	//测试字符串的长度 一个汉字算2个字节
	function mb_strlen(str)
	{
		var len=str.length;
		var totalCount=0;
		for(var i=0;i<len;i++)
		{
			var c = str.charCodeAt(i);
			if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
				totalCount++;
			}else{
				totalCount+=2;
			}
		}
		return totalCount;
	}
	/*
	var Util = {};
	Util.calWbText = function (text, max){
		if(max === undefined)
			max = 500;
		var cLen=0;
		var matcher = text.match(/[^\x00-\xff]/g),
			wlen  = (matcher && matcher.length) || 0;
		//匹配url链接正则 http://***
		var pattern = /http:\/\/([\w-]+\.)+[\w-]+(\/*[\w-\.\/\?%&=][^\s^\u4e00-\u9fa5]*)?/gi;
		//匹配的数据存入数组
		var arrPt = new Array();
		var i = 0;
		while((result = pattern.exec(text)) != null){
			arrPt[i] = result[0];
			i++;
		}
		//替换掉原文本中的链接
		for(var j = 0;j<arrPt.length;j++){
			text = text.replace(arrPt[j],"");
		}
		//减掉链接所占的长度
		return Math.floor((max*2 - text.length - wlen)/2 - 12*i);
	};
	*/
	var allowComment = '0';
	
	//举报弹出层
	function showJuBao(url, cid){
		
			$.cover(false);
			asyncbox.open({
				id  : 'report_thickbox',
				url : url,
				title : '举报违规',
				width : 378,
				height : 240,
				scroll : 'no',
				data : {
					'cid'	 : cid,
					'idtype' : 2 
				},
				callback : function(action){
					if(action == 'close'){
						$.cover(false);
					}
				}
			});
	}

	$(function(){
		//顶  js中暂未添加&过滤 
		$('#digg').live('click' , function(){

			if(isOnLine == '' )
			{
				//showErrorMsg('登录之后才能进行此操作' , '消息提示');
				showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				return false;
			}

			var bid = $('#digg').attr('bid');
			var url = $('#digg').attr('url');

			var digg_str = $.cookie('digg_id');
			if(digg_str != null)
			{
				var arr= new Array(); //定义一数组

				arr = digg_str.split(","); //字符分割     
				for( i=0 ; i < arr.length ; i++ )   
				{   
					if(bid == arr[i])
					{
						showErrorMsg('已经赞过该文章', '消息提示'); 
						return false;
					}
				} 
			}
			$.ajax({
				type:"POST",
				url:url,	
				data: {
					'bid' : bid 
				},
				dataType: 'json',
				success:function(msg){
					if(msg.error == 0)
					{
						var num = parseInt($('#digg_num').html(),10);
						num += 1;
						$('#digg_num').html(num);
						$('#digg').die();

						if(digg_str == null)
						{
							$.cookie('digg_id', bid, {expires: 30 , path: '/'});
						}
						else
						{
							$.cookie('digg_id', digg_str + ',' + bid, {expires: 30 , path: '/'});
						}
						showSucceedMsg('谢谢' , '消息提示');
					}
					else if(msg.error == 1)
					{
						//showErrorMsg(msg.error_content , '消息提示'); 
						showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
					}
					else if(msg.error == 2)
					{
						showErrorMsg(msg.error_content , '消息提示'); 
					}
				}
			});
		});
		//举报弹出层
		/*$('.box_report').live('click' , function(){
			if(isOnLine == '' )
			{
				//showErrorMsg('登录之后才能进行此操作' , '消息提示');
				showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				return false;
			}
			var url = $('#report_url').val();
			var cid = $(this).attr('cid');
			$.cover(false);
			asyncbox.open({
				id  : 'report_thickbox',
				url : url,
				title : '举报违规',
				width : 378,
				height : 240,
				scroll : 'no',
				data : {
					'cid'	 : cid,
					'idtype' : 2 
				},
				callback : function(action){
					if(action == 'close'){
						$.cover(false);
					}
				}
			});
		});*/


		//评论相关代码
		
		//点击回复显示评论框
		$('.Blog_a10').live('click' , function(){
			if(isOnLine == '' )
			{
				//showErrorMsg('登录之后才能进行此操作' , '消息提示');
				showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				return false;
			}

			if(allowComment == 1)
			{
				showErrorMsg('该博文不允许评论' , '消息提示'); 
				return false;
			}
			var tid = $(this).attr('toid');//留言作者id
			var bid = $(this).attr('bid');//blogid
			var cid = $(this).attr('cid');//留言id
			var tname = $(this).attr('tname');
			var tpl  = '<div class="Blog_right1_9">';
				tpl +=	 '<div class="div2">';
				tpl +=     '<textarea name="" cols="" rows="" class="Blog_ar1_1" id="rmsg">文明上网，理性发言...</textarea>';
				tpl +=	 '</div>';
				tpl +=   '<div class="div3">';
				tpl +=		'<div class="div3_2"><a href="javascript:void(0);" class="Blog_a11" id="quota_sbumit" url="/Comment/PostComment.html" tid="'+tid+'" bid="'+bid+'" cid="'+cid+'" tname="'+tname+'" ></a><a href="javascript:void(0)" id="qx_comment" class="Blog_a12"></a></div>';
				tpl +=		'<div class="div3_1"><a href="javascript:void(0);" id="mface"><span></span>表情</a></div>';
				tpl +=		'<div class="clear"></div>';
				tpl +=	 '</div>';
				tpl +=  '</div>';
			$('.z_move_comment').html('');
			$(this).parents('.Blog_right1_8').find('.z_move_comment').html(tpl).show();
		});
		//引用的评论提交
		$('#quota_sbumit').live('click' , function(){

			if(isOnLine == '' )
			{
				//showErrorMsg('登录之后才能进行此操作' , '消息提示');
				showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				return false;
			}

			var bid   = $(this).attr('bid');
			var tid   = $(this).attr('tid');//被引用人的id
			var qid   = $(this).attr('cid');//引用的id
			var url = $(this).attr('url');
			var text = $('#rmsg').val();
			var tname = $(this).attr('tname');
			if(text == '' || text=='文明上网，理性发言...')
			{
				showErrorMsg('评论内容不能为空！' , '消息提示'); 
				return false;
			}
			else
			{
				if(mb_strlen(text) > 1000){
					showErrorMsg('评论内容不能超过500个汉字' , '消息提示'); 
					return false;
				}
			}
		    $.ajax({
		        type: "post",
			    url: url ,
			    data: {'bid': bid , 'to' : tid , 'qid' : qid , 'text': text , 'tname' : tname },
				dataType: 'json',
			    success: function(data){
				    if(data.code == 1){
						var tpl =  '<div class="Blog_right1_8">';
							tpl+=     '<div class="Blog_right_img1"><a href="' +data.info.url+ '" >' + data.info.header + '</a></div>';
							tpl+=     '<div class="Blog_right_font1">';
							tpl+=         '<p class="Blog_p5"><span><a href="' +data.info.url+ '" >' + data.info.username + '</a></span>' + data.info.dateline + '</p>';
							tpl+=         '<p class="Blog_p7"><a href="' + data.info.quota.url + '">' + data.info.quota.username + '</a>：'+ data.info.quota.content + '</p>';
							tpl+=         '<p class="Blog_p8">' + data.info.content + '</p><span class="span_text1"><a href="javascript:void(0);" class="Blog_a10" toid=' + data.info.fuid + ' bid=' + data.info.bid + ' cid=' + data.info.cid + '  tname = ' + data.info.username + ' >回复</a> | 　<a class="comment_del_mark" style="cursor:pointer" url="' + data.info.delurl + '" >删除</a>　| 　<a href="javascript:showJuBao(\'/blog/ViewReport.html\','+data.info.cid+')" class="box_report" cid="' + data.info.cid + '" >举报</a></span></div>';
							tpl+=         '<div class="z_move_comment" style="display:none"></div>';
							tpl+=	      '<div class="Blog_line1"></div></div>';
							$('#replyList .Blog_right1_8:first').before(tpl);
							$('.z_move_comment').html('').hide();
				    }
					else if(data.code == -1){
						//showErrorMsg(data.info , '消息提示'); 
						showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
			        }
                },
			    error: function(){//请求出错处理
                        
                }
			});
		});
		//底部发表评论
		$('#submitmsg').click(function(){
			if(allowComment == 1)
			{
				showErrorMsg('该博文不允许评论' , '消息提示'); 
				return false;
			}
			var bid   = $(this).attr('bid');
			var toid  = $(this).attr('toid');
			var text = $('#reply').val();
			var url = $(this).attr('url');
			if(text == '' || text=='文明上网，理性发言...')
			{
				showErrorMsg('评论内容不能为空！' , '消息提示'); 
				return false;
			}
			else
			{
				if(mb_strlen(text) > 1000){
					showErrorMsg('评论内容不能超过500个汉字' , '消息提示'); 
					return false;
				}
			}
		    $.ajax({
		        type: "post",
			    url: url ,
			    data: {'bid': bid , 'to' : toid ,'text': text},
				dataType: 'json',
			    success: function(data){
				    if(data.code == 1)
					{
						var tpl   = '<div class="Blog_right1_8">';
							tpl  +=   '<div class="Blog_right_img1"><a href="' +data.info.url+ '" >' + data.info.header + '</a></div>';
							tpl  +=	  '<div class="Blog_right_font1">';
							tpl  +=       '<p class="Blog_p5"><span><a href="' +data.info.url+ '" >' + data.info.username + '</a></span>' + data.info.dateline + '</p>';
							tpl  +=       '<p class="Blog_p6">' + data.info.content + '</p>';
							tpl  +=		  '<div class="div1"><a href="javascript:void(0);" class="Blog_a10"  toid=' + data.info.fuid + ' bid=' + data.info.bid + ' cid=' + data.info.cid + '>回复</a> | 　<a class="comment_del_mark" style="cursor:pointer" url="' + data.info.delurl + '">删除</a>　| 　<a href="javascript:showJuBao(\'/blog/ViewReport.html\','+data.info.cid+')" class="box_report" cid="' + data.info.cid + '">举报</a></div>';
							tpl  +=		  '<div class="z_move_comment" style="display:none"></div>';
							tpl  +=    '</div><div class="Blog_line1"></div></div>';
							$('.Blog_tit3:first').after(tpl);
							$('#reply').val('文明上网，理性发言...');
					}
					else if(data.code == -1)
					{
						showErrorMsg(data.info , '消息提示'); 
			        }
                },
			    error: function(){//请求出错处理
                        
                }
		    });
			
		});
		//底部评论重置
		$('#reset_comment').click(function(){
			$('#reply').val('文明上网，理性发言...');
		});
		//取消回复
		$('#qx_comment').live('click' , function(){
			$('.z_move_comment').html('').hide();
		});


		$('#rmsg, #reply').live({
		    focus:function(){
			    if($(this).val() == '文明上网，理性发言...'){
			        $(this).val('');
			    }
			},
			blur:function(){
		        if($(this).val() == ''){
			        $(this).val('文明上网，理性发言...');
			    }
			}
		});
		//删除留言确认
		$('.comment_del_mark').live('click' , function(){
			var url = $(this).attr('url');
			asyncbox.confirm('删除留言','确认', function(action){
				if(action == 'ok')
				{
					location.href = url;
				}
			});
		});
		//删除时间确认
		$('.del_article_id').click(function(){
			var delurl = $(this).attr('delurl');
			asyncbox.confirm('删除文章','确认', function(action){
				if(action == 'ok')
				{
					location.href = delurl;
				}
			});
		});
		/*
		//字数限制
		$('#rmsg, #reply').live('keyup', function(){
			var id = $(this).attr('id');
			var left = Util.calWbText($(this).val(), 500);
			var eid = '#errmsg';
			
			if(id == 'reply') eid =  '#rerrmsg';
			if (left >= 0)
		        $(eid).html('您还可以输入<span>' + left + '</span>字');
		    else
		        $(eid).html('<font color="red">您已超出<span>' + Math.abs(left) + '</span>字 </font>');
		});
		*/
		//加载表情
	    $('#face').qqFace({id : 'facebox1', assign : 'reply', path : '/image/qqface/'});
	    $('#mface').qqFace({id : 'facebox', assign : 'rmsg', path:'/image/qqface/'});
	    
		/*
		$('#class_one_id').change(function(){
			alert(123213);
			var id = parseInt($(this).val() , 10);
			if(id == 0) return false;
			$('.hidden_son_class span').each(function( index , dom ){
				if( dom.attr('cid')  == id )
				{
				}
			});
		});
		*/
		//转载文章
		var turn_url = "/blog/viewClassPart.html";
		$('#repost_bar').click(function(){
			if(isOnLine == '' )
			{
				//showErrorMsg('登录之后才能进行此操作' , '消息提示');
				showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				return false;
			}
			var id = $(this).attr('bid');
			asyncbox.open({
				id  : 'turn_class_thickbox',
				url : turn_url,
				title : '转载文章',
				width : 330,
				height : 131,
				scroll : 'no',
				data : {
					'id'	 : id
				},
				callback : function(action){
					if(action == 'close'){
						$.cover(false);
					}
				}
			});
		});
		/*
	    //转发文章
	    $('#repost_bar').live('click' , function(){
			if(isOnLine == '' )
			{
				//showErrorMsg('登录之后才能进行此操作' , '消息提示');
				showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				return false;
			}
	    	var bid  = $(this).attr('bid');
	    	var url  = $(this).attr('url');
	    	asyncbox.confirm('转载文章','确认', function(action){
	    	  if(action == 'ok'){
	    	    $.ajax({
				type:"POST",
				url:url,	
				data: {
					'bid' : bid 
				},
				dataType: 'json',
				success:function(msg){
				  if(msg.error == 0){
				    showSucceedMsg('转发成功！', '消息提示');
				  }else if(msg.error == 1){
				    //location.href = '/index.php?r=site/login';
					showErrorMsg('操作失败,您需要先登录!', '消息提示', '/site/login.html');
				  }else{
				    showErrorMsg(msg.error_content, '消息提示');
			      }
				}
			  });
	    	  }
	    	});

		});
		*/

	});
</script>
<!--该部分应该放在输出代码块的后面才起作用 -->
<script type="text/javascript">

SyntaxHighlighter.autoloader(
	'applescript			/highlight/scripts/shBrushAppleScript.js',
	'actionscript3 as3		/highlight/scripts/shBrushAS3.js',
	'bash shell				/highlight/scripts/shBrushBash.js',
	'coldfusion cf			/highlight/scripts/shBrushColdFusion.js',
	'cpp c					/highlight/scripts/shBrushCpp.js',
	'c# c-sharp csharp		/highlight/scripts/shBrushCSharp.js',
	'css					/highlight/scripts/shBrushCss.js',
	'delphi pascal			/highlight/scripts/shBrushDelphi.js',
	'diff patch pas			/highlight/scripts/shBrushDiff.js',
	'erl erlang				/highlight/scripts/shBrushErlang.js',
	'groovy					/highlight/scripts/shBrushGroovy.js',
	'java					/highlight/scripts/shBrushJava.js',
	'jfx javafx				/highlight/scripts/shBrushJavaFX.js',
	'js jscript javascript	/highlight/scripts/shBrushJScript.js',
	'perl pl				/highlight/scripts/shBrushPerl.js',
	'php					/highlight/scripts/shBrushPhp.js',
	'text plain				/highlight/scripts/shBrushPlain.js',
	'py python				/highlight/scripts/shBrushPython.js',
	'ruby rails ror rb		/highlight/scripts/shBrushRuby.js',
	'scala					/highlight/scripts/shBrushScala.js',
	'sql					/highlight/scripts/shBrushSql.js',
	'vb vbnet				/highlight/scripts/shBrushVb.js',
	'xml xhtml xslt html	/highlight/scripts/shBrushXml.js'
);
SyntaxHighlighter.all();


function code_hide(id){
	var code = document.getElementById(id).style.display;
	if(code == 'none'){
		document.getElementById(id).style.display = 'block';
	}else{
		document.getElementById(id).style.display = 'none';
	}
}
</script>
  <!-- footer -->
  <div class="Blog_footer" style='clear:both'>
    <div><a href="http://www.chinaunix.net/about/index.shtml" target="_blank" rel="nofollow">关于我们</a> | <a href="http://www.it168.com/bottomfile/it168.shtml" target="_blank" rel="nofollow">关于IT168</a> | <a href="http://www.chinaunix.net/about/connect.html" target="_blank" rel="nofollow">联系方式</a> | <a href="http://www.chinaunix.net/about/service.html" target="_blank" rel="nofollow">广告合作</a> | <a href="http://www.it168.com//bottomfile/flgw/fl.htm" target="_blank" rel="nofollow">法律声明</a> | <a href="http://sso.chinaunix.net/Register?return_url=http%3A%2F%2Fblog.chinaunix.net%2F
" target="_blank" rel="nofollow">免费注册</a>
      <p>Copyright  2001-2010 ChinaUnix.net All Rights Reserved 北京皓辰网域网络信息技术有限公司. 版权所有 </p>
      <div>感谢所有关心和支持过ChinaUnix的朋友们
        <p>京ICP证041476号 京ICP证060528号</p>
      </div>
    </div>
  </div>
</div>
<script language="javascript">

//全局错误提示弹出框
function showErrorMsg(content, title, url){
	var url = url || '';
	var title = title || '消息提示';
	var html = '';
	html += '<div class="HT_layer3_1 HT_layer3_2"><ul><li><p><span class="login_span1"></span>' + content + '</p></li>';
	if(url == '' || url.length == 0){
		html += '<li class="HT_li1"><input type="button" class="HT_btn2"  onclick=\'close_windows("error_msg")\'></li>';	
	} else {
		html += '<li class="HT_li1"><input type="button" class="login_btn1" onclick="location.href=\'' + url + '\'"></li>';
	}
	html += '</ul></div>';
	$.cover(true);
	   asyncbox.open({
		 id: 'error_msg',
		 title : title,
		 html : html,
		 'callback' : function(action){
			 if(action == 'close'){
				 $.cover(false);
			 }
		 }
	});
}

//全局正确提示
function showSucceedMsg(content, title , url ){
	var url = url || '';
	var title = title || '消息提示';
	var html = '';
	html += '<div class="HT_layer3_1 HT_layer3_2"><ul><li><p><span class="login_span2"></span>' + content + '</p></li>';
	if(url == '' || url.length == 0){
		html += '<li class="HT_li1"><input type="button" class="HT_btn2"  onclick=\'close_windows("error_msg")\'></li>';	
	} else {
		html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick="location.href=\'' + url + '\'"></li>';
	}
	html += '</ul></div>';
	$.cover(true);
	asyncbox.open({
		 id: 'error_msg',
		 title : title,
		 html : html,
		 'callback' : function(action){
			 if(action == 'close'){
				 $.cover(false);
			 }
		 }
	});
}

//关闭指定id的窗口
function close_windows(id){
	$.cover(false);
	$.close(id);
}


//公告
var tID;
var tn;                        // 高度
var nStopTime = 5000;        // 不同行间滚动时间隔的时间，值越小，移动越快
var nSpeed = 50;            // 滚动时，向上移动一像素间隔的时间，值越小，移动越快
var isMove = true;
var nHeight = 25;
var nS = 0;
var nNewsCount = 3;

/**
 * n 用于表示是否为第一次运行
 **/
function moveT(n)
{
    clearTimeout(tID)
    var noticev2 = document.getElementById("noticev2")
    nS = nSpeed;
    
    // 只在第一次调用时运行，初始化环境（有没有参数）
    if (n)
    {
        // 设置行高
        noticev2.style.lineHeight = nHeight + "px";
        // 初始化显示位置
        tn = 0;
        // 刚进入时在第一行停止时间
        nS = nStopTime;
    }
    
    // 判断鼠标是否指向层
    if (isMove)
    {
        // 向上移动一像素
        tn--;
        // 如果移动到最下面一行了，则移到顶行
        if (Math.abs(tn) == nNewsCount * nHeight)
        {
            tn = 0;
        }
        // 设置位置
        noticev2.style.marginTop = tn + "px";
        // 完整显示一行时，停止一段时间
        if (tn % nHeight == 0)
        {
            nS = nStopTime;
        }
    }

    tID = setTimeout("moveT()", nS);
}
moveT(1);    // 此处可以传入任何参数
</script>
<script language="javascript" src="http://stat.it168.com/pv.js"></script>
<script>
function sendPV(){
    var pvTrack = new PvTrack();
    pvTrack.type = 35; // 频道类别ID
    pvTrack.channel = 189; // 频道ID
    pvTrack.pageType = 0;
    pvTrack.track();
}
window.setTimeout("sendPV()", 1000);
</script>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20237423-2']);
  _gaq.push(['_setDomainName', '.chinaunix.net']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F0ee5e8cdc4d43389b3d1bfd76e83216b' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript" src="/js/jquery.qqFace.js"></script>
</body>
</html>
